<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<%@include file="/common/meta.jsp"%>
<%@include file="/common/extjs.jsp"%>
<%@include file="/common/validator.jsp"%>
<script type="text/javascript" src="${ctx}/pages/rbcs/base/item/treeCombox.js"> </script>
<link href="${ctx}/styles/treeSelect.css" type='text/css' rel='stylesheet'>
<script type="text/javascript">
Ext.onReady(function() {
	var rtree = new TreeCombox({
		el : 'comboxWithTree',
		target : 'item_id',
		url : '${ctx}/base/item/itemTree.do',
		defValue : {id:'${model.parent.id}', text:'${model.parent.name}'}
	});
	rtree.init();	
	
});
</script>
</head>
<body>
<div class="x-panel" style="width: 100%">
<div class="x-panel-header" style="border-bottom: 1px solid #97B7E7;">科目管理</div>
<div align="center" style="padding-top:10px;">
  <div style="width:510px;">
	<%@ include file="/common/messages.jsp"%>
  </div>
  <s:form action="save.do" id="save" method="post">
  <fieldset style="width:500px;">
    <legend>编辑科目信息</legend>
	    <s:hidden name="model.id" />
	    <br>
	    <table width="500" border="0" style="line-height: 30px;">
		  <tr>
		    <td align="right" width="100">上级科目：</td>
		    <td width="400">
		      <div id='comboxWithTree' style=""></div>
		      <input type="hidden" id="item_id" name="parentId" value="${model.parent.id}">
		    </td>
		  </tr>
		  <tr>
			<td align="right">科目编码：</td>
			<td>
			  <s:textfield id="code" name="model.code" size="36" cssClass="required" maxlength="50"/>
			  <font color="red">&nbsp;*</font>
			</td>
		  </tr>
		  <tr>
			<td align="right">科目名称：</td>
			<td>
			  <s:textfield id="name" name="model.name" size="36" cssClass="required" maxlength="50"/>
			  <font color="red">&nbsp;*</font>
			</td>
		  </tr>
		  <tr>
			<td align="right">是否分摊科目：</td>
			<td>
			  <s:radio name="model.isShare" list="#{'1':'是','0':'否'}" cssStyle="border:0px;"></s:radio>
			</td>
		  </tr>
		  <tr>
		    <td align="right">科目描述： </td>
		    <td>
		      <s:textarea id="descn" name="model.descn" cssStyle="width:250px; height:70px;"></s:textarea>
		    </td>
		  </tr>
		</table>
		<br>
	</fieldset>
	<div>
	  <br>
	  <s:submit value="保存" cssClass="button" />&nbsp;&nbsp;
	  <input type="button" value="返回" class="button">
	</div>
  </s:form>
</div>
</div>

<script type="text/javascript">
$(document).ready(function() {
$("#save").validate();
});
</script>
</body>
</html>